class Solution {
public:
    vector<vector<int>> v;
    vector<int> path;
    int ret;
    int subsetXORSum(vector<int>& nums) {
        dfs(nums,0);
        return ret;
    }

    void dfs(vector<int>& nums,int pos)
    {
        int x=0;
       for(int i=0;i<path.size();++i)
       {
            x^=path[i];
       }
       ret+=x;

       for(int j=pos;j<nums.size();++j)
       {
            path.push_back(nums[j]);
            dfs(nums,j+1);
            path.pop_back();
       }
       return;
    }
};
